#!/bin/bash
source src/conf/config.conf

mkdir -p /var/www/tftp
cd $tftp_dir


echo "ALL : ALL" >> /etc/hosts.allow
echo "" >> /etc/hosts.deny
mkdir esx
mkdir experience
mkdir tools
mkdir -p kaos
mkdir -p LINUX/{dsl,ipcop}
mkdir -p LINUX/{centos,fedora}/{i386,x86_64}
mkdir -p LINUX/ubuntu/{dapper,quantal}/{i386,amd64}
mkdir -p LINUX/debian/{wheezy,lenny,squeeze}/{i386,amd64,powerpc,ia64}
mkdir -p BSD/{openbsd,freebsd,netbsd,archbsd}/{i386,amd64,powerpc}
mkdir -p xenserver
mkdir -p sources
cat sources/wim-here
mkdir -p boot
cat boot/boot-here

cat conf/xena > xenserver/answerfile
cd ..
tar -xvf pxelinux.cfg.tar -C tftp/
tar -xvf files.tar -C tftp/
tar -xvf answerfiles.tar -C tftp/

cd tftp/
cat > tftpd.remap << EOF
gr \\ /
EOF

cd ..

mkdir mirrors
